﻿using LY.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.DataAccess.Repository
{
    public class CompanydocumentRepository : BaseRepository
    {
        //根据项目Id查询信息
        public List<U_Companydocument> GetCompanydocumentList(int id)
        {
            string sql = @" SELECT [Id]
                          ,[CompanyId]
                          ,[DocPath]
                           FROM [U_Companydocument]
                           where CompanyId=@CompanyId";
            return base.Query<U_Companydocument>(sql, new { CompanyId = id });
        }
        //根据主键Id查询信息
        public string GetCompanydocumentListbyId(int id)
        {
            string sql = @" SELECT [DocPath]
                          FROM [U_Companydocument]
                            where Id=@Id";
            return base.Get<T_Document>(sql, new { Id = id }).DocPath;
        }
        //删除
        public int DeleteImagesbyId(int id)
        {
            string sql = "delete from U_Companydocument where Id=@Id ";
            return base.Excute(sql, new { Id = id });
        }
    }
}
